package projectwork.shchuangge.cn.com.newproject.uitls;

import projectwork.shchuangge.cn.com.newproject.ui.fragment.BagFragment;
import projectwork.shchuangge.cn.com.newproject.ui.fragment.HomeFragment;
import projectwork.shchuangge.cn.com.newproject.ui.fragment.MeFragment;
import projectwork.shchuangge.cn.com.newproject.ui.fragment.ShoppingFragment;

/**
 * Created by 赵航 on 2017/6/21.
 */

public class FragementFactory {
    private static final FragementFactory ourInstance = new FragementFactory();
    private static HomeFragment     homeFragment;
    private static ShoppingFragment shoppingFragment;
    private static MeFragment       meFragment;
    private static BagFragment bagFragment;

    public static FragementFactory getInstance() {
        return ourInstance;
    }

    private FragementFactory() {
        System.out.println("111111111");
    }

    public static HomeFragment getHomeFragemt() {

        if (homeFragment == null) {
            homeFragment = new HomeFragment();
        }
        return homeFragment;
    }

    public static ShoppingFragment getShoppingFragment() {
        if (shoppingFragment == null) {
            shoppingFragment = new ShoppingFragment();
        }
        return shoppingFragment;
    }

    public static MeFragment getMeFragment() {


        if (meFragment == null) {
            meFragment = new MeFragment();
        }
        return meFragment;
    }

    public static BagFragment getBagFragment() {

        if (bagFragment == null) {
            bagFragment = new BagFragment();
        }

        return bagFragment;
    }
}
